﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleInOutControl.DBModels
{
    /// <summary>
    /// 操作员信息
    /// </summary>
    [SugarTable(TableDescription = "操作员信息")]
    [SugarIndex("Index_{table}_Name", nameof(Name), OrderByType.Asc)]
    public class UserInfo
    {
        /// <summary>
        /// ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "ID")]
        public int? ID { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [SugarColumn(ColumnDescription = "用户名")]
        public string? Name { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [SugarColumn(ColumnDescription = "密码")]
        public string? Password { get; set; }
        /// <summary>
        /// 录入日期
        /// </summary>
        [SugarColumn(IsNullable = true, DefaultValue = "now()", ColumnDescription = "录入日期")]
        public DateTime? EntryDate { get; set; } = DateTime.Now;
        /// <summary>
        /// 最后登录时间
        /// </summary>
        [SugarColumn(IsNullable =true, ColumnDescription = "最后登录时间")]
        public DateTime? LastLoginTime { get; set; }
        /// <summary>
        /// 启用状态
        /// </summary>
        [SugarColumn(ColumnDescription = "启用状态")]
        public bool? IsEnabled { get; set; } = true;
        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDataType = "text", ColumnDescription = "备注")]
        public string? Notes { get; set; }
    }
}
